<div class="lines-ajax">
    <h2>{notempty name="info.lines_id"}编辑{else /}添加{/notempty}台词</h2>
    <form class="user-form" action="{:zanpian_user_url('user/center/addlines')}">
        <input type="hidden" id="lines_id" name="lines_id" value="{$info['lines_id']|default=''}">
        <input type="hidden" id="lines_vid" name="lines_vid" value="{$info.vod_id|default=''}">
        <div class="user-input">
            <label>视频名：</label>
            <input name="vod_name" id="vod_name" type="text" placeholder="视频名" value="{$info.vod_name|default=''}" readonly>
        </div>
        {empty name="role.role_id"}
        <div class="user-input user-select-text">
            <label>角色名：</label>
            <input name="lines_role" id="id_input" type="text" placeholder="演员名" value="{$info.lines_role|default=''}">
            <a id="get_role">选择</a>
        </div>
        <div class="user-input user-select">
            <label>选择角色名：</label>
            <select id="id_select" onChange="selectOnChangeFunc()">
                {volist name="role_list" id="zanpian"}
                <option value="{$zanpian.role_name}" {eq name="zanpian['role_name']" value="$info['lines_role']"}selected{/eq}>{$zanpian.role_name}</option>
                {/volist}
            </select>
        </div>
        {else /}
        <div class="user-input">
            <label>角色名：</label>
            <input name="lines_role" id="id_input" type="text" placeholder="演员名" value="{$role.role_name|default=''}" readonly>
        </div>
        {/empty}
        <div class="user-input user-textarea">
            <label>台词内容：</label>
            <textarea name="lines_content" placeholder="台词内容" style=" width:100%; height:200px">{$info['lines_content']}</textarea>
        </div>
        <div class="user-input">
            <label>验证码：</label>
            <input data="validate" name="validate" type="text" placeholder="验证码">
            <img class="validate-img" src="{:url('home/verify/index',array('t'=>time()))}">
        </div>
        <button type="submit" class="user-btn" id="add-lines">提交</button>
    </form>
</div>

<script type="text/javascript">
    function selectOnChangeFunc() {
        document.getElementById('id_input').value = document.getElementById('id_select').options[document.getElementById('id_select').selectedIndex].value;
    }
</script>